package com.irdstudio.efp.nls.api.rest.sed;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.irdstudio.basic.framework.core.constant.DataRuleType;
import com.irdstudio.basic.framework.core.constant.ResponseData;
import com.irdstudio.basic.framework.web.controller.AbstractController;
import com.irdstudio.efp.e4a.service.facade.SRoleDataRuleService;
import com.irdstudio.efp.rule.service.facade.TaxIncomeTaxInfoService;
import com.irdstudio.efp.rule.service.vo.TaxIncomeTaxInfoVO;


/**
 * Controller：收入纳税信息表
 * @author ligm
 * @date 2019-04-29 
 */
@RestController
@RequestMapping("/api")
public class TaxIncomeTaxInfoController extends AbstractController  {
	
	@Autowired
	@Qualifier("taxIncomeTaxInfoService")
	private TaxIncomeTaxInfoService taxIncomeTaxInfoService;
    
	@Autowired
	@Qualifier("sRoleDataRuleService")
	private SRoleDataRuleService sRoleDataRuleService;


    /**
	 * 新增数据 
	 * @param inTaxIncomeTaxInfoVo
	 * @return 
	 */
    @PostMapping(value="/tax/income/tax/info")
	public @ResponseBody ResponseData<Integer> insertTaxIncomeTaxInfo(@RequestBody TaxIncomeTaxInfoVO inTaxIncomeTaxInfoVo) {
        
		
		

		int outputVo = taxIncomeTaxInfoService.insertTaxIncomeTaxInfo(inTaxIncomeTaxInfoVo);
		return getResponseData(outputVo);	
	}

    /**
	 * 根据主键删除信息 
	 * @param inTaxIncomeTaxInfoVo
	 * @return 
	 */
	@DeleteMapping(value="/tax/income/tax/info")
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody TaxIncomeTaxInfoVO inTaxIncomeTaxInfoVo) {
        
		
		

		int outputVo = taxIncomeTaxInfoService.deleteByPk(inTaxIncomeTaxInfoVo);
		return getResponseData(outputVo);
	}

    /**
	 * 根据主键更新信息 
     * @param inTaxIncomeTaxInfoVo
	 * @return 
	 */
	@PutMapping(value="/tax/income/tax/info")
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody TaxIncomeTaxInfoVO inTaxIncomeTaxInfoVo) {
        
		
		

		int outputVo = taxIncomeTaxInfoService.updateByPk(inTaxIncomeTaxInfoVo);
		return getResponseData(outputVo);
	}

    /**
	 * 根据主键查询详情 
     * @param taxIncomeTaxInfo
	 * @return 
	 */
	@GetMapping(value="/tax/income/tax/info")
	public @ResponseBody ResponseData<TaxIncomeTaxInfoVO> queryByPk() {	
        
		
		

		TaxIncomeTaxInfoVO inVo = new TaxIncomeTaxInfoVO();
		TaxIncomeTaxInfoVO outputVo = taxIncomeTaxInfoService.queryByPk(inVo);
		return getResponseData(outputVo);
	} 

    /**
	 * 列表数据查询 
	 * @param taxIncomeTaxInfo
	 * @return 
	 */
	@RequestMapping(value="/tax/income/tax/infos", method=RequestMethod.POST)
	public @ResponseBody ResponseData<List<TaxIncomeTaxInfoVO>> queryTaxIncomeTaxInfoAll(@RequestBody TaxIncomeTaxInfoVO vo) {

		List<TaxIncomeTaxInfoVO> outputVo = null;
		setUserInfoToVO(vo);

		outputVo = taxIncomeTaxInfoService.queryAllByLevelOne(vo);
		
		return getResponseData(outputVo);	
	}
}
